#ifndef KC_KEYWORDCOND_H__KC
#define KC_KEYWORDCOND_H__KC

#include <unicode/unistr.h>
#include "Operator.h"
#include "Symbol.h"
#include "HowManyCond.h"

namespace kc_sf
{
	enum KeywordRange
	{
		Headers,
		Body,
		Everywhere,
		Subject
	};

	class KeywordCond : public HowManyCond
	{
		public:
			
			KeywordCond( Operator keyword_operator,
					const std::string &keyword,
					KeywordRange keyword_range );

			Logic::Symbol *clone() const;

			bool eval( const Message &msg );

		private:

			Operator c_keyword_operator;
			UnicodeString c_keyword;
			KeywordRange c_keyword_range;
			int c_matches;

			void eval( const UnicodeString &input );
	};
}

#endif /* KC_KEYWORDCOND_H__KC */
